package day09demo;

public class GirlFriend {
    private String name;
    private int age;
    private String gender;
    public GirlFriend(){

    }


    public GirlFriend(String name ,int age,String gender){
        this.name = name;
        this .gender = gender;
    }
    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name = name;
    }
    public String getGender(){
        return gender;
    }
    public void setGender(String gender){
        this.gender = gender;
    }
    public void setAge(int a){
        if (a >= 18 && a <= 50){
            age = a;
        }else {
            System.out.println("非法数据");
        }
    }
    public int getAge(){
        return age;
    }

    public void sleep(){
        System.out.println("女朋友在睡觉");
    }
    public void eat(){
        System.out.println("女朋友在吃饭");
    }
}
